<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Amaze UI Admin form Examples</title>
<meta name="description" content="这是一个form页面">
<meta name="keywords" content="form">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="../../assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="../../assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="../../assets/css/amazeui.min.css" />
<link rel="stylesheet" href="../../assets/css/admin.css">


 <%
	var isAdd = false;
	var isEdit = false;
	
	if(isEmpty(productCategory.id)){
		isAdd = true;
	}else{	
		isEdit = true;
   }%>
</head>
<body>
	<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

	<header class="am-topbar am-topbar-inverse admin-header">
		<div class="am-topbar-brand">
			<strong>Amaze UI</strong> <small>后台管理模板</small>
		</div>

		<button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}">
			<span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span>
		</button>

		<div class="am-collapse am-topbar-collapse" id="topbar-collapse">

			<ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
				<li><a href="javascript:;"><span class="am-icon-envelope-o"></span> 收件箱 <span class="am-badge am-badge-warning">5</span></a></li>
				<li class="am-dropdown" data-am-dropdown><a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;"> <span class="am-icon-users"></span>
						管理员 <span class="am-icon-caret-down"></span>
				</a>
					<ul class="am-dropdown-content">
						<li><a href="#"><span class="am-icon-user"></span> 资料</a></li>
						<li><a href="#"><span class="am-icon-cog"></span> 设置</a></li>
						<li><a href="#"><span class="am-icon-power-off"></span> 退出</a></li>
					</ul></li>
				<li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
			</ul>
		</div>
	</header>

	<div class="am-cf admin-main">
		<!-- sidebar start -->
		<% include("/includes/header_menu.html"){} %>
		<!-- sidebar end -->

		<!-- content start -->/productCategory/insert
		<div class="admin-content">
			<form id="Form" name="Form" class="am-form" action="<%if (isAdd){%>/productCategory/insert<%}else{%>/productCategory/update<%}%>" method="post">
			  <input type="hidden" name="productCategory.id" value="${productCategory.id!}" />
				<div class="admin-content-body">
					<div class="am-cf am-padding am-padding-bottom-0">
						<div class="am-fl am-cf">
							<strong class="am-text-primary am-text-lg">商品管理</strong> / <small><%if(isAdd){%>添加商品分类<%}else{%>编辑商品分类<%}%></small>
						</div>
					</div>
					<hr>
					<div class="am-g am-margin-top">
						<div class="am-u-sm-4 am-u-md-2 am-text-right">分类名称:</div>
						<div class="am-u-sm-8 am-u-md-4">
							<input type="text" name="productCategory.name" class="am-input-sm" value="${productCategory.name!}"  required />
						</div>
						<div class="am-hide-sm-only am-u-md-6">*必填，不可重复</div>
					</div>
					<div class="am-g am-margin-top">
						<div class="am-u-sm-4 am-u-md-2 am-text-right">上级分类:</div>
						<div class="am-u-sm-8 am-u-md-4" style="float: left">
						  <%if(isAdd){%>
						<select name="productCategory.parent_id" data-am-selected="{btnSize: 'sm'}">
						<option value=""></option> 
							<option value="root">顶级分类</option> 
							<%for(list in productCategoryTreeList){%>
								<option value="${list.id}">
								<%if (list.level != 0){%> 
									<%for( i in range(0,list.level))
										{%>--<%}%> 
									<%}%> 
								${list.name}
								</option> 
							<%}%>
							</select>
							<%}else{%>
							${productCategory.parent.name!'顶级分类'}
							<%}%> 
						</div>
					</div>

					<div class="am-g am-margin-top">
						<div class="am-u-sm-4 am-u-md-2 am-text-right">排序</div>
						<div class="am-u-sm-8 am-u-md-4">
							<input type="text" name="productCategory.orderList" class="am-input-sm" value="${productCategory.orderList!50}" title="只允许输入零或正整数" required />
						</div>
						<div class="am-hide-sm-only am-u-md-6 am-text-warning">${orderListMessages!}</div>
					</div>
					<div class="am-g am-margin-top">
			            <div class="am-u-sm-4 am-u-md-2 am-text-right">页面关键词</div>
			            <div class="am-u-sm-8 am-u-md-4">
			              <input type="text" name="productCategory.metaKeywords" class="am-input-sm" value="${productCategory.metaKeywords!}" />
			            </div>
			            <div class="am-hide-sm-only am-u-md-6 am-text-warning">&nbsp;</div>
			          </div>


		          <div class="am-g am-margin-top">
		            <div class="am-u-sm-4 am-u-md-2 am-text-right">页面描述</div>
		            <div class="am-u-sm-8 am-u-md-4">
		              <textarea name="productCategory.metaDescription" rows="7">${productCategory.metaDescription!}</textarea>
		            </div>
		            <div class="am-hide-sm-only am-u-md-6 am-text-warning">&nbsp;</div>
		          </div>

					<div class="am-margin">
						<button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
						<button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="window.history.back(); return false;">放弃保存</button>
					</div>
				</div>
			</form>
			<footer class="admin-content-footer">
				<hr>
				<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
			</footer>
		</div>
		<!-- content end -->

	</div>

	<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

	<footer>
		<hr>
		<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
	</footer>

	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="../../assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

	<!--[if (gte IE 9)|!(IE)]><!-->
	<script src="../../assets/js/jquery.min.js"></script>
	<!--<![endif]-->
	<script src="../../assets/js/amazeui.min.js"></script>
	<script src="../../assets/js/app.js"></script>
</body>
</html>
